export default {
  namespaced: true,
  state() {
    return {
      goods: [
        { name: "商品1", price: 9999 },
        { name: "商品2", price: 999.9 },
        { name: "商品3", price: 99.99 },
      ],
    };
  },
  getters: {
    filterGoods(state) {
      let arr = state.goods.filter((item) => {
        return item.price > 500;
      });
      return arr;
    },
  },
  mutations: {
    goodsAddMut(state, gdata) {
      state.goods.push(gdata);
    },
  },
};
